package com.mocoop.commom;

import java.io.File;

import android.content.Context;
import android.os.Environment;

public class MyConstants {

	public final static boolean isDebug = true;

	public static String BASE_URL = "file:///android_asset/html/";//"http://192.168.253.1:3001/";//"http://192.168.1.115:3001/";//"http://192.168.43.71:3001/";// //
	public static String SERVICE_URL = "https://qc.tradeicloud.com/QC";//"http://demo.tradeicloud.com/QC";//"https://qc.tradeicloud.com/QC";// "http://110.80.35.58:23801";//"http://192.168.1.112:3001";
	
	public static String UPGRADE_SERVICE_URL = "https://esbrun.chinacnd.com:20001/esb";
//	public static String UPGRADE_SERVICE_URL = "https://service.chinacnd.com:446/esb";
	
	// 请求不同表数据的url
	// QC_ORDER
	public final static String URL_ORDER = "/get/getOrderList";
	// QC_PROCESS
	public final static String URL_PROCESS = "/get/getOrderProcessList";
	//现在没有用
	public final static String URL_SUBPROCESS = "/get/getOrderSubProcessList";
	//QC_PARTY
	public final static String URL_PARTY = "/get/getOrderPartyList";
	//QC_ABNORMAL
	public final static String URL_ABNORMAL = "/get/getAbnormalList";
	//QC_REMARK
	public final static String URL_REMARK = "/get/getRemarkList";
	//QC_DYNAMIC
	public final static String URL_DYNAMIC = "/get/getDynamicList";
	//QC_MESSAGE
	public final static String URL_MESSAGE = "/get/getMessageList";

	public final static String QC_ORDER = "Create  TABLE QC_ORDER([unreadCount] int default 0,[remark] varchar,[customerName] varchar,[customerNo] varchar,[localPK] varchar,[processStatus] varchar,[abnormalStatus] varchar,[remarkStatus] varchar,[sellerID] varchar,[attachment] varchar(5000),[lastUpdateTime] bigint(20),[orderNo] varchar,[itemNo] varchar,[quantity] int,[createdDate] bigint(20),[exFactoryDate] bigint(20),[status] varchar,[jsonPK] varchar UNIQUE,[ID] integer PRIMARY KEY AUTOINCREMENT);";
	public final static String QC_PROCESS = "Create  TABLE QC_PROCESS([unreadCount] int default 0,[abnormalStatus] varchar,[remarkStatus] varchar,[completeQuantity] int,[completeQuantityEdit] int,[completeQuantityStatus] varchar,[subProcessStatus] varchar,[lastModifiedByUserLogin] varchar,[localPK] varchar,[lastUpdateTime] bigint(20),[processName] varchar,[status] varchar(10),[statusEdit] varchar(10),[statusStatus] varchar(10),[actualTime] bigint(20),[actualTimeEdit] bigint(20),[actualTimeStatus] varchar,[estimatedTime] bigint(20),[estimatedTimeEdit] bigint(20),[estimatedTimeStatus] varchar,[sno] int,[remindDate] bigint(20),[orderID] varchar,[jsonPK] varchar UNIQUE,[ID] integer PRIMARY KEY AUTOINCREMENT)";
	public final static String QC_REMARK = "Create  TABLE QC_REMARK([remarkStatus] varchar,[unread] varchar default 'T',[toUserID] varchar,[toUserName] varchar,[toUserNameEdit] varchar,[toUserNameStatus] varchar,[attachmentEdit] varchar,[attachmentStatus] varchar,[completeQuantity] int,[completeQuantityEdit] int,[completeQuantityStatus] varchar,[descriptionEdit] varchar(5000),[descriptionStatus] varchar,[localPK] varchar UNIQUE,[createStatus] varchar,[objID] varchar,[attachment] varchar,[lastUpdateTime] bigint(20),[lastModifiedByUserLogin] varchar,[createdByUserLogin] varchar,[createdByUserID] varchar,[orderID] varchar,[createdTime] bigint(20),[description] varchar(5000),[type] int(1),[jsonPK] varchar UNIQUE,[ID] integer PRIMARY KEY AUTOINCREMENT)";
	public final static String QC_ABNORMAL = "Create  TABLE QC_ABNORMAL([unread] varchar default 'T',[statusEdit] varchar,[abnormalStatusStatus] varchar,[remarkStatus] varchar,[localPK] varchar UNIQUE,[createStatus] varchar,[lastUpdateTime] bigint(20),[lastModifiedByUserLogin] varchar,[createdByUserLogin] varchar,[createdTime] bigint(20),[status] varchar(10),[description] varchar(5000),[descriptionEdit] varchar(5000),[descriptionStatus] varchar,[completeRate] varchar,[orderID] varchar,[processID] varchar,[attachment] varchar,[attachmentEdit] varchar,[attachmentStatus] varchar,[jsonPK] varchar UNIQUE,[ID] integer PRIMARY KEY AUTOINCREMENT)";
	public final static String QC_PARTY = "Create  TABLE QC_PARTY([localPK] varchar,[lastUpdateTime] bigint(20),[buyerID] varchar,[sellerID] varchar,[customerName] varchar,[buyerName] varchar,[sellerName] varchar,[jsonPK] varchar UNIQUE,[ID] integer PRIMARY KEY AUTOINCREMENT)";
	public final static String QC_DYNAMIC = "Create TABLE QC_DYNAMIC([unread] varchar default 'T',[orderID] varchar,[docKeyIDList] varchar,[sourceKeyID] varchar,[type] varchar,[localPK] varchar,[lastUpdateTime] bigint(20),[createdDate] bigint(20),[description] varchar,[lastModifiedByUserLogin] varchar,[createdByUserLogin] varchar,[attachment] varchar,[jsonPK] varchar UNIQUE,[ID] integer PRIMARY KEY AUTOINCREMENT)";
	public final static String QC_MESSAGE = "Create TABLE QC_MESSAGE([unread] varchar default 'T',[orderID] varchar,[lastUpdateTime] bigint(20),[createdDate] bigint(20),[message] varchar,[attachment] varchar,[lastModifiedByUserLogin] varchar,[createdByUserLogin] varchar,[jsonPK] varchar UNIQUE,[ID] integer PRIMARY KEY AUTOINCREMENT)";

	// public static String USERID = "";

	public static String getPath(Context activity, String userID) {
		boolean sdCardExist = Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED);
		String path = "";
		if (sdCardExist) {
			path = Environment.getExternalStorageDirectory().toString();
		} else {
			path = activity.getFilesDir().getPath();
		}
		path += File.separator + activity.getPackageName() + File.separator + userID + File.separator;
		File file = new File(path);
		if (!file.exists()) {
			file.mkdirs();
		}
		return path;
	}

}
